<%@ page language="java" import="java.util.*,com.ncp.model.biz.product.*,com.ncp.model.dao.*,com.ncp.model.entity.product.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ArrayList listroot = (ArrayList)request.getAttribute("listroot");
ArrayList listparent = (ArrayList)request.getAttribute("listparent");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ManagerSort.jsp' starting page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  <script text="text/JavaScript">
<!--

<!--

String.prototype.Trim = function() 
{ 
return this.replace(/\s/g,""); 
} 

function check(){ 
	  var P_sortname=document.form_test.sortname.value;
	  var sortname=P_sortname.Trim();
  
     if(sortname==""){
     window.alert("输入内容不能为空！");
	 document.form_test.sortname.focus();
	 return false;
	 
   }
  }
function abc(){

   return window.confirm("你真的要删除该种类名称吗,注意哦！！连属于这个种类的产品也会删除哦"); 
}
-->
</script>
 <body>
<style type="text/css"">
a{ color:#000; text-decoration:none;}
a.delete:hover{ color:#666; text-decoration:underline;}
.delete{ float:right;}
.item{ float:left;}
td{ border:1px solid #ccc; padding:0 10px; height:30px; line-height:30px;}
</style>
	<div id="contain">
		<div id="user">
		<form action="ManagerSortServlet" method="post" name="form_test">
<table width="600" border="0" align="center">
  
  <%
  int time=0;
  for(int i=0;i<listroot.size();i++){
	
  %>
  <tr>
  <%
  for(int j=0;j<4&&time<listroot.size();j++){
	 
	  ProductSortBean psb = (ProductSortBean)listroot.get(time++);
	 
  %>
  <td>
  <a class="item" href="ManagerUpdateServlet?type=ProductSort&ProductID=<%=psb.getProductSortID()%>">
  <%=psb.getProductSortName() %>
  </a>
 &nbsp;&nbsp;<a class="delete" onclick="return abc();" href="ManagerBasicDelServlet?type=delsort&ProductID=<%=psb.getProductSortID()%>">删除</a>
  </td>
  <%
  if(j%4!=0){
	  
  }
    }
  
  %>
   </tr>
  <%
  }
 %>
 
  <tr>
    <td colspan="2">请输入你要增加的产品种类的名称</td>
    <td colspan="2"><label for="textfield"></label>
    <input type="text" name="sortname" id="textfield" /></td>
  </tr>
  </table>
   <p style="text-align:center;">
   <label for="Submit" style=" margin-right:30px;">
    <input type="submit" name="Submit" value="确定" id="Submit" onclick="return(check())"/></label>
   <label for="Submit" style=" margin-left:30px;">
    <input type="reset" name="Submit2" value="重置" id="Submit2" /></label>
   </p>
  </form>
	</div>
</div>
</body>
</html>
